<?php
/**
 * 商品分类验证器
 */

namespace app\common\validate;

class GoodsCategoryValidate extends Validate
{
    protected $rule = [
            'name|分类名称' => 'require',
    'pid|父级id' => 'require',
    'level|等级' => 'require',
    'sort|排序' => 'require',
    'is_show|是否显示:1-是;0-否' => 'require',
    'is_recommend|是否首页推荐：1-是；0-否' => 'require',
    'image|分类图片' => 'require',
    'remark|分类描述' => 'require',

    ];

    protected $message = [
            'name.require' => '分类名称不能为空',
    'pid.require' => '父级id不能为空',
    'level.require' => '等级不能为空',
    'sort.require' => '排序不能为空',
    'is_show.require' => '是否显示:1-是;0-否不能为空',
    'is_recommend.require' => '是否首页推荐：1-是；0-否不能为空',
    'image.require' => '分类图片不能为空',
    'remark.require' => '分类描述不能为空',

    ];

    protected $scene = [
        'add'  => ['name','pid','level','sort','is_show','is_recommend','image','remark',],
'edit' => ['name','pid','level','sort','is_show','is_recommend','image','remark',],

    ];

    

}
